package com.ftx.controller.test.thread;

/**
 * Created by fengtingxin on 2020-11-04.
 **/
public class Singleton {

    private volatile static Singleton singleton;

    public static Singleton getInstance(){
        if (singleton == null){
            synchronized (Singleton.class){
                singleton = new Singleton();
            }
        }
        return singleton;
    }
}
